Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: /
QuickDraw 3D RAVE / QuickDraw 3D RAVE Reference
QuickDraw 3D RAVE Routines / Private Draw Context Methods


TQADrawPrivateNew

A drawing engine must define a method to create its own private data and initialize a new draw context.

typedef TQAError (*TQADrawPrivateNew) (
                                       TQADrawContext *newDrawContext, 
                                       const TQADevice *device, 
                                       const TQARect *rect, 
                                       const TQAClip *clip, 
                                       unsigned long flags);
newDrawContext
The draw context to initialize. On entry, all the fields of this structure have the value NULL.
device
A device.
rect
The rectangular region (specified in device coordinates) of the specified device that can be drawn into by the drawing engine associated with the new draw context.
clip
The two-dimensional clipping region for the new draw context, or NULL if no clipping is desired. This parameter must be set to NULL for devices of type kQADeviceMemory.
flags
A set of bit flags specifying features of the new draw context. See "Draw Context Flags Masks" (page 1-65) for complete information.
DESCRIPTION
Your TQADrawPrivateNew function is called whenever an application calls QADrawContextNew to create a new draw context associated with your drawing engine. Your function should perform any initialization required for the new draw context. In particular, it should return a pointer to the draw context's private data in the drawPrivate field of the draw context structure pointed to by the newDrawContext parameter. In addition, your TQADrawPrivateNew function should set any other fields of that draw context structure to point to public draw context methods defined by the drawing engine.

Because it is the responsibility of your TQADrawPrivateNew function to initialize the fields of a draw context structure, you can load different methods depending on the features of the device or draw context specified by the device and flags parameters. For instance, you might load one line drawing function for a device that displays 16 bits per pixel and a different line drawing function for a device that displays 32 bits per pixel. This technique allows you to avoid testing the display depth each time you draw a line.

SEE ALSO
See Listing 1-8 (page 1-26) for a sample TQADrawPrivateNew function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
28 AUG 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help